/**
 * Copyright (c) 2018-2028, Joffee.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.sailmi.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.sailmi.common.mybatis.base.TenantEntity;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Date;
import java.util.Objects;

/**
 * 实体类
 *
 * @author Joffee
 */

@TableName("ucs_user")
public class User extends TenantEntity {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键id
	 */
	@Schema(name = "主键")
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;
	/**
	 * 编号
	 */
	@TableField("safe_code")
	@Schema(name = "安全码")
	private String code;
	/**
	 * 账号
	 */
	@TableField("login_name")
	@Schema(name = "账号")
	private String account;
	/**
	 * 密码
	 */
	@TableField("password")
	@Schema(name = "密码")
	private String password;
	/**
	 * 昵称
	 */
	@TableField("nick_name")
	@Schema(name = "昵称")
	private String name;
	/**
	 * 真名
	 */
	@TableField("real_name")
	@Schema(name = "真实姓名")
	private String realName;
	/**
	 * 头像
	 */
	@TableField("head_img")
	@Schema(name = "用户头像")
	private String avatar;
	/**
	 * 邮箱
	 */
	@TableField("user_email")
	@Schema(name = "邮箱")
	private String email;
	/**
	 * 手机
	 */
	@TableField("user_phone")
	@Schema(name = "手机号")
	private String phone;
	/**
	 * 生日
	 */
	@TableField("user_birthday")
	@Schema(name = "出生日期")
	private Date birthday;
	/**
	 * 性别
	 */
	@TableField("user_sex")
	@Schema(name = "用户性别")
	private Integer sex;
	/**
	 * 地址
	 */
	@TableField("user_address")
	@Schema(name = "地址")
	private String userAddress;
	/**
	 * 实名认证状态:1已认证，0未认证
	 */
	@Schema(name = "实名认证状态:1已认证，0未认证")
	@TableField("real_status")
	private String realStatus;
	/**
	 * 上次登陆时间
	 */
	@Schema(name = "上次登陆时间")
	@TableField("last_login")
	private String lastLogin;
	/**
	 * 企业认证状态:1已认证，0未认证
	 */
	@Schema(name = "企业认证状态:1已认证，0未认证")
	@TableField("enterprise_status")
	private String enterpriseStatus;
	/**
	 * 手机认证:0未认证,1已认证
	 */
	@Schema(name = "手机认证:0未认证,1已认证")
	@TableField("phone_status")
	private String phoneStatus;
	/**
	 * 邮箱认证:0未认证,1已认证
	 */
	@Schema(name = "邮箱认证:0未认证,1已认证")
	@TableField("email_status")
	private String emailStatus;
	/**
	 * 账户完善信息:0未完成,1已完成
	 */
	@Schema(name = "账户完善信息:0未完成,1已完成")
	@TableField("info_status")
	private String infoStatus;
	/**
	 * 上次登陆的企业ID
	 */
	@Schema(name = "默认登陆的企业ID")
	@TableField("default_enterprise")
	private Long defaultEnterpriseId;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public String getUserAddress() {
		return userAddress;
	}

	public void setUserAddress(String userAddress) {
		this.userAddress = userAddress;
	}

	public String getRealStatus() {
		return realStatus;
	}

	public void setRealStatus(String realStatus) {
		this.realStatus = realStatus;
	}

	public String getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(String lastLogin) {
		this.lastLogin = lastLogin;
	}

	public String getEnterpriseStatus() {
		return enterpriseStatus;
	}

	public void setEnterpriseStatus(String enterpriseStatus) {
		this.enterpriseStatus = enterpriseStatus;
	}

	public String getPhoneStatus() {
		return phoneStatus;
	}

	public void setPhoneStatus(String phoneStatus) {
		this.phoneStatus = phoneStatus;
	}

	public String getEmailStatus() {
		return emailStatus;
	}

	public void setEmailStatus(String emailStatus) {
		this.emailStatus = emailStatus;
	}

	public String getInfoStatus() {
		return infoStatus;
	}

	public void setInfoStatus(String infoStatus) {
		this.infoStatus = infoStatus;
	}

	public Long getDefaultEnterpriseId() {
		return defaultEnterpriseId;
	}

	public void setDefaultEnterpriseId(Long defaultEnterpriseId) {
		this.defaultEnterpriseId = defaultEnterpriseId;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (!(o instanceof User user)) return false;
		return Objects.equals(id, user.id) && Objects.equals(code, user.code) && Objects.equals(account, user.account) && Objects.equals(password, user.password) && Objects.equals(name, user.name) && Objects.equals(realName, user.realName) && Objects.equals(avatar, user.avatar) && Objects.equals(email, user.email) && Objects.equals(phone, user.phone) && Objects.equals(birthday, user.birthday) && Objects.equals(sex, user.sex) && Objects.equals(userAddress, user.userAddress) && Objects.equals(realStatus, user.realStatus) && Objects.equals(lastLogin, user.lastLogin) && Objects.equals(enterpriseStatus, user.enterpriseStatus) && Objects.equals(phoneStatus, user.phoneStatus) && Objects.equals(emailStatus, user.emailStatus) && Objects.equals(infoStatus, user.infoStatus) && Objects.equals(defaultEnterpriseId, user.defaultEnterpriseId);
	}

	@Override
	public int hashCode() {
		return Objects.hash(id, code, account, password, name, realName, avatar, email, phone, birthday, sex, userAddress, realStatus, lastLogin, enterpriseStatus, phoneStatus, emailStatus, infoStatus, defaultEnterpriseId);
	}
}
